﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WAF.Server;
using WAF.Server.Ipc;

namespace PerformanceTests
{
    class PerformanceTestNoIpc : PerformanceTestBase
    {
        public PerformanceTestNoIpc()
        {
            appServer = new AppServerCore();
            appServer.Init(ProcessResponse);
            webServer = new WebServerCore();
            webServer.Init(ProcessAppServerRequest, ProcessNativeResponse);
        }

        public override void SendRequest(ContentRequest request)
        {
            base.SendRequest(request);
            webServer.ProcessNativeRequest(request, null);
        }

        void ProcessResponse(ContentResponse response)
        {
            webServer.ProcessAppServerResponse(response);
        }


        void ProcessAppServerRequest(ContentRequest request)
        {
            appServer.ProcessRequest(request);
        }

        void ProcessNativeResponse(ContentResponse response, object nativeContext)
        {
            RecceiveResponse(response);
        }

    }
}
